# -*- coding: utf-8 -*-
import  keyword
from copy import deepcopy

import  wx.stc  as  stc
import  wx
from stc.stc_input import STCInput
from stc.stc_output import STCOutput
from stc.stc_debug import STCDebug

from config import faces

demoText= """# \\
J \\
  J 



a

"""

def runTest(frame, nb, log):
  p = wx.Panel(nb, -1, style = wx.NO_FULL_REPAINT_ON_RESIZE)

  ed2 = STCOutput(p, -1, faces)
  faces_ed3 = deepcopy(faces)
  faces_ed3["size"] = 6
  faces_ed3["size2"] = 5
  ed3 = STCOutput(p, -1, faces_ed3)
  ed = STCInput(p, -1, faces, ed2, ed3)
  s = wx.BoxSizer(wx.HORIZONTAL)
  s.Add(ed, 1, wx.EXPAND)
  s.Add(ed2, 1, wx.EXPAND)
  s.Add(ed3, 1, wx.EXPAND)
  p.SetSizer(s)
  p.SetAutoLayout(True)


  #ed.SetText(demoText + open('Main.py').read())
  ed.SetText(demoText)
  ed.EmptyUndoBuffer()
  ed.Colourise(0, -1)
  # line numbers in the margin
  ed.SetMarginType(1, stc.STC_MARGIN_NUMBER)
  ed.SetMarginWidth(1, 25)

  return p


if __name__ == '__main__':
  import sys,os
  import run
  run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
